package com.mes.spc.rule;

import java.util.ArrayList;
import java.util.List;

public class SPCDetermineMethod {
	public double UCL;
    public double LCL;
    public double USL;
    public double LSL;
    public double standard;
    public List<SPCCommandbase> Commands = new ArrayList<SPCCommandbase>();
    
    public double getUCL() {
		return UCL;
	}
	public void setUCL(double uCL) {
		UCL = uCL;
	}
	public double getLCL() {
		return LCL;
	}
	public void setLCL(double lCL) {
		LCL = lCL;
	}
	public double getStandard() {
		return standard;
	}
	public void setStandard(double standard) {
		this.standard = standard;
	}
	public double getUSL() {
		return USL;
	}
	public void setUSL(double uSL) {
		USL = uSL;
	}
	public double getLSL() {
		return LSL;
	}
	public void setLSL(double lSL) {
		LSL = lSL;
	}
	
	public SPCDetermineMethod(double usl,double lsl,double ucl,double lcl,double standard,SPCCommandbase[] commands)
    {
		this.USL = usl;
		this.LSL = lsl;
        this.UCL = ucl;
        this.LCL = lcl;
        this.standard = standard;
        for (SPCCommandbase command :commands)
        {
            this.Commands.add(command);
        }
    }
    public SPCDetermineMethod(double usl,double lsl,double ucl, double lcl, double standard,List<SPCCommandbase> commands)
    {
    	this.USL = usl;
		this.LSL = lsl;
        this.UCL = ucl;
        this.LCL = lcl;
        this.standard = standard;
        this.Commands = commands;
    }
    public List<SPCCommandbase> Excute(double data)
    {
        List<SPCCommandbase> result = new ArrayList<SPCCommandbase>();
        for(SPCCommandbase command : this.Commands)
        {
            if (command.excute(data, this.USL, this.LSL, this.UCL, this.LCL, this.standard))
                result.add(command);
        }
        return result;
    }
}
